//
//  ICOrganizationViewController.h
//  ICome
//
//  Created by zhangrongwu on 16/3/18.
//  Copyright © 2016年 iCom. All rights reserved.
//

#import "ICBaseViewController.h"
#import "ICEmpInfoModel.h"
#define GROUP_maximum 200

typedef void(^ICEmpSingleSelection)(NSArray *list); // 选择 不能取消逻辑
typedef void (^ICUserSelection)(NSArray *userList); // 选择 可以取消逻辑
typedef void(^ICOrgSingleSelection)(NSArray *list); // 选择 组织

typedef  enum {
    CtrStyleDefault_sdk,  // 组织架构
    CtrStyleDepart_sdk,  // 部门
    CtrStyleEmploye_sdk, // 创建／添加 / 删除成员
    CtrStyleSelectEmploye_sdk, // 选择 员工
    CtrStyleSelectNode_sdk,  // 选择 组织 节点
    CtrStyleOther_sdk
}ICCtrStyle_sdk;

typedef enum {
    GroupStyleCreateEmployee = 1, // 按人员创建会话
    GroupStyleCreateNode = 2, // 按节点创建会话（部门）
    GroupStyleSelectNode = 3,   // － 选择部门
    GroupStyleSelectEmployee = 4  // － 选择人员
}ICGroupStyle;

@class ICOrganizationViewController;

@protocol ICOrganizationCtrDelegate <NSObject>

@optional

- (void)appendUserWithDictionary:(NSDictionary *)dict; // 添加用户

@end

@interface ICOrganizationViewController : ICBaseViewController

@property (nonatomic, assign)NSUInteger maxCount; // 可选最大人数

@property (nonatomic, strong)NSString *titleName;
@property (nonatomic, strong)NSString *oId;
@property (nonatomic, strong)NSString *eId;

@property (nonatomic, strong)NSString *backFlag;


@property (nonatomic, assign)ICCtrStyle_sdk CtrStyle;
@property (nonatomic, assign)NSInteger kkGroupType;

@property (nonatomic, assign)BOOL singleSelect; // 单选用户 用于轻应用

@property (nonatomic, strong)NSMutableArray *recordList;

@property (nonatomic, weak)id <ICOrganizationCtrDelegate> delegate;

@property (nonatomic, copy)ICEmpSingleSelection singleSelectionEmp;
@property (nonatomic, copy)ICOrgSingleSelection singleSelectionOrg;
@property (nonatomic, copy)ICUserSelection selectionUserList;

// 选中的人员是否可以取消 默认不可以
@property (nonatomic, assign)BOOL canCancelSelect;

/** 单选用户记录*/
@property (nonatomic, strong)NSMutableArray *appuserList;

@property (nonatomic, strong)NSMutableArray *users; // 记录


/*************************添加成员时用到*****************************/
@property (nonatomic, strong)NSString *gId;
@property (nonatomic, assign)BOOL isAppendUser;


@end
